Skip to content

Conversation

@nicola-morganti
Copy link

Performance: Add React.memo() to list components

What changed

  • Added React.memo() to ModRow, ContentPackRow, CapeItemDisplay, and CapeCard
  • Added useCallback for callbacks in ModsTab
  • Prevents unnecessary re-renders in mod/cape lists

Why

  • Large mod lists (100+ items) were causing performance issues
  • Every parent update was re-rendering all list items
  • Scrolling through capes was laggy

Impact

  • Smoother scrolling in mod and cape lists
  • Reduced CPU usage during list interactions
  • No functional changes, just performance improvements

Testing

  • All existing functionality works the same
  • No linter errors
  • Tested with large mod lists

- Add React.memo() to ModRow, ContentPackRow, CapeItemDisplay, and CapeCard
- Optimize callback functions with useCallback in ModsTab
- Prevent unnecessary re-renders in virtualized lists
- Improve performance for large mod and cape collections

Components optimized:
- ModRow: Prevents re-renders when mod list updates
- ContentPackRow: Optimizes resource pack rendering
- CapeItemDisplay: Reduces cape list rendering overhead
- CapeCard: Improves cape browser performance
- ModsTab: Stabilizes callback references with useCallback

Expected performance improvements:
- Reduced CPU usage during list scrolling
- Fewer memory allocations from stable references
- Smoother UI interactions in profile management
@copyandexecute
Copy link
Contributor

I'll check later, thanks for your PR!

@S42yt
Copy link
Member

S42yt commented Sep 16, 2025

please use yarn and not pnpm

@copyandexecute
Copy link
Contributor

would you mind using dev/curseforge as your branch? I changed alot of things

@nicola-morganti nicola-morganti changed the base branch from v3 to dev/curseforge September 28, 2025 06:50
@nicola-morganti
Copy link
Author

Sure, no problem, I just changed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants